<template>
	<view>
        <!-- 公共组件-每个页面必须引入 -->
        <public-module></public-module>
        <wlk-navbar title="商品搜索" navbarType='0'></wlk-navbar>
        <view class="search-content">
            <u-search placeholder="请输入关键词" v-model="keyword" :actionStyle="{
                color:themeColor
            }" height="38" @search="jump(keyword)"  :focus="true" @custom="jump(keyword)"  actionText="搜索" :searchIconColor="themeColor" margin="30rpx 0"></u-search>
        </view>
	</view>
</template>

<script>
    import { mapGetters } from 'vuex';
    import { toUrl } from '@/wlkutils/tools';
	export default {
        computed: {
            ...mapGetters(['themeColor','uEmpty'])
        },
		data() {
			return {
                keyword:''
			};
		},
        onLoad(option) {
            if(option.keyword){
                this.keyword = option.keyword;
            }
        },
        methods: {
            jump(index){
                if (!uni.$u.test.isEmpty(index)) {
                    toUrl('/pages/goods/list?keyword='+index);
                }
            }
        }
	}
</script>

<style lang="scss">
    page{
        background-color: #FFFFFF;
        .search-content{
            width: 92%;
            margin: 0 auto;
            .title{
                margin: 40rpx 0 20rpx 0;
            }
            .tag-item{
                margin: 20rpx 20rpx 0 0;
            }
        }
    }
</style>
